package cn.hhchat.wp.config;

import cn.hhchat.wp.entity.ConfigEntity;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.Map;

public class WeeklyConfig {

    private Map<String, ConfigEntity> configs;

    public ConfigEntity get(String name) {
        return configs.get(name);
    }

    public ConfigEntity set(String name, ConfigEntity config) {
        return configs.put(name, config);
    }

    public WeeklyConfig(Map<String, ConfigEntity> configs) {
        this.configs = configs;
    }

    public Map<String, ConfigEntity> getConfigs() {
        return new HashMap<>(this.configs);
    }
}